// $Id: DocumentPropertyTester.java 49 2011-10-17 19:07:29Z huijzer@gmail.com $
package lime.browser.command;

import lime.model.Document;

import org.eclipse.core.expressions.PropertyTester;

public class DocumentPropertyTester extends PropertyTester {

	private static final String CHECKEDOUT = "checkedout";
	
	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
		if (property.equals(CHECKEDOUT)) {
			Document doc = (Document) receiver;
			Boolean expected = (Boolean) expectedValue;
			if (doc.isCheckedOut() == expected) {
				return true;
			}
		}
		return false;
	}
	
}
